function trim(str){ 
  return str.replace(/^\s+|\s+$/g,''); 
}

function checkForm(){
	if(document.getElementById("title")==null || trim(document.getElementById("title").value)=="")
	{
	  alert('请填写公告标题！');
	  document.getElementById("title").focus();
	  return false;
	}
	var content_data = CKEDITOR.instances.content.getData();
		content_data = content_data.replace("<br />","");
		content_data = content_data.replace("<br>","");
		content_data = trim(content_data);
		if(content_data==""){
			 alert('请填写公告内容！');
			 CKEDITOR.instances.content.focus();
			 return false;
		}

	document.addForm.submit();
}

function search(){
		document.indexForm.submit();
}

function selectAll(){
		var listsize = document.getElementById('listsize').value;
		if(document.getElementById('checkall').checked){
			for(var i=0;i<listsize;i++){
					document.getElementById('checkone'+i).checked = true;
			}
		}else{
			for(var i=0;i<listsize;i++){
					document.getElementById('checkone'+i).checked = false;
			}
		}
}

function delIndexInfos(){
	var listsize = document.getElementById('listsize').value;
	var pkid_string = '';
	for(var i=0;i<listsize;i++){
		if(document.getElementById('checkone'+i).checked){		  
			pkid_string += document.getElementById('checkone'+i).value+'|';
		}
	}
	if(pkid_string == ''){
		alert('请至少选择一条！');
		return false;
	}
	document.getElementById('pkid').value = pkid_string;
	document.indexForm.action='/doTradeReg.do';
	if(window.confirm('确认删除吗？')){
		document.indexForm.submit();
	}
}

function delOneNews(val){
	 
  if(window.confirm('确认删除吗？'))
  {
 	  window.location.href='/doTradeReg.do?pkid='+val+'&bpm_id=5023'; 
  } 
 
}